<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    手机号码：<input type="text" placeholder="110"><button>发送短信</button>
    <script>
        let bth = document.querySelector('button');
        let time = 3;

        bth.addEventListener('click',function () {
            bth.disabled = true;
            let timer =  setInterval(function (){
                if (time === 0 ) {
                    clearInterval(timer);
                    bth.disabled = false;
                    bth.innerHTML = '发送短信';
                    time = 3;
                } else {
                    bth.innerHTML = '还剩下' + time + '秒';
                    time--;
                }
            },1000)
        })

    </script>
</body>
</html>